﻿using Restaurant.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Restaurant.Client.Controls
{
    /// <summary>
    /// u_Table.xaml 的交互逻辑
    /// </summary>
    public partial class u_Table : UserControl
    {
        public CompanyTable CompanyTable { get; set; }

        public delegate void ThisClick(u_Table sender);
        public event ThisClick Delete;
        public u_Table()
        {
            InitializeComponent();


        }
        public u_Table(CompanyTable companyTable) : this()
        {
            CompanyTable = companyTable;
            tb_Number.Text = CompanyTable.TableNum;
            tb_Count.Text = "人数:" +  CompanyTable.PeopleCount.ToString();
            tb_Remarks.Text = "备注" + CompanyTable.Remarks;
        }

        private void btn_Delete_Click(object sender, RoutedEventArgs e)
        {
            Delete?.Invoke(this);
        }
    }
}
